package view.listener;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Shell;

import control.Storage;
import control.Util;

public class CloseButtonListener extends SelectionAdapter {

	private Shell shell;

	public CloseButtonListener(Shell shell) {
		this.shell = shell;
	}

	@Override
	public void widgetSelected(SelectionEvent arg0) {

		Storage.getInstance().setConfigured(false);
		Storage.getInstance().setNewGame(false);

		Util.closeWindow(shell);
	}
}
